import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:honeypotflutter/public/views/public_appBar.dart';
import 'package:honeypotflutter/public/views/public_scrollView.dart';
import 'package:honeypotflutter/publicBussine/bussine_colors.dart';
import 'package:honeypotflutter/publicBussine/bussine_font.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_button.dart';
import 'logic.dart';

class AutonymStatusPage extends StatefulWidget {
  const AutonymStatusPage({Key? key}) : super(key: key);

  @override
  State<AutonymStatusPage> createState() => _AutonymStatusPageState();
}

class _AutonymStatusPageState extends State<AutonymStatusPage> {
  final AutonymStatusLogic logic = Get.put(AutonymStatusLogic());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: MGColors.whileColor,
      appBar: HLAppBar(navigationTitle: "认证中心", showBottomLine: true),
      body: HLScrollView(
        crossAxisAlignment: CrossAxisAlignment.center,
        padding: EdgeInsets.only(left: 20, right: 20, top: 40),
        children: [
          Obx(
            () => Image.asset(logic.icons.value, width: 80),
          ),
          Container(
            padding: EdgeInsets.only(top: 15),
            width: double.infinity,
            child: Obx(() => Text(
                  logic.status.value,
                  textAlign: TextAlign.center,
                  style: TextStyle(
                    color: MGColors.text1Color,
                    fontSize: MGFont.titleFont2,
                    fontWeight: FontWeight.bold,
                  ),
                )),
          ),
          SizedBox(height: 10),
          Obx(() => Text(
                logic.remind.value,
                maxLines: 20,
                textAlign: TextAlign.center,
                style: TextStyle(
                  color: MGColors.text3Color,
                  fontSize: MGFont.textFont1,
                ),
              )),
          logic.showButton.value
              ? Obx(
                  () => MGButton(
                    margin: EdgeInsets.only(top: 40),
                    title: logic.buttonTitle.value,
                    buttonAction: logic.clickAction,
                  ),
                )
              : Container(),
        ],
      ),
    );
  }

  @override
  void dispose() {
    Get.delete<AutonymStatusLogic>();
    super.dispose();
  }
}
